<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <fmt:setBundle basename="ApplicationMessage" />
  <fmt:setLocale value="zh_CN" />

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  <link href="${ctx.resource}/css/select2.css" rel="stylesheet">
  <link href="${ctx.resource}/css/select2-bootstrap.css" rel="stylesheet">
  <title>待确认回款 - 租房宝金融管理平台</title>
</head>
<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>
  
  <div class="web-g-main">

    <%@ include file="/WEB-INF/include/aside.jsp"%>
    <div class="content">
      <header class="header clearfix">
          <h3 class="pull-left">待确认回款订单</h3>
       </header>

       <c:if test="${not empty infoMessage}">
            <div class="alert alert-success alert-dismissable alert-fade top-margin-10 text-align-center">
              <button type="button" class="close" data-dismiss="alert">&times;</button>
              <i class="glyphicon glyphicon-info-sign"></i>&nbsp;&nbsp;
              <fmt:message key="${infoMessage}" />
            </div>
       </c:if>

       <div class="table-area table-responsive">
           <table class="table table-striped table-hover">
              <thead>
                <tr>
                  <th>订单号</th>
                  <th>租约号</th>
                  <th>租客</th>
                  <th>收款方</th>
                  <th>应付日期</th>
                  <th>订单金额</th>
                  <th>订单状态</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
                <c:forEach var="order" items="${orderList}">
                  <tr>                 
                    <td>${order.orderNo}</td>
                    <td>${order.contract.contractNo}</td>
                    <td>${order.customer.name}</td>
                    <td>${not empty data.getFactoringContract(order.contract.contractNo) ? data.getFactoringContract(order.contract.contractNo).company.fullName : order.customer.app.company.fullName}</td>
                    <td><fmt:formatDate value="${order.dueDate}" pattern="yyyy/MM/dd" /></td>
                    <td>&yen;&nbsp;${order.totalRent}</td>
                    <td>
                      <c:choose>
                        <c:when test="${not empty order and order.settled }">已核销</c:when>
                        <c:otherwise><fmt:message key="${order.orderStatus.key}" /></c:otherwise>
                      </c:choose>
                    </td>
                    <td>
                      <a href="${ctx}/orders/all/${order.id}/detail">详情</a>
                    </td>
                  </tr>
                </c:forEach>
              </tbody>
           </table>
           <div class="divider"></div>
           <table class="table table-striped table-hover">
              <thead>
                <tr>
                  <th>订单号</th>
                  <th>租约号</th>
                  <th>租客</th>
                  <th>收款方</th>
                  <th>应付日期</th>
                  <th>订单金额</th>
                  <th>订单状态</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
                <c:forEach var="order" items="${orderBufferingDeductList}">
                  <tr>                 
                    <td>${order.orderNo}</td>
                    <td>${order.contract.contractNo}</td>
                    <td>${order.customer.name}</td>
                    <td>${not empty data.getFactoringContract(order.contract.contractNo) ? data.getFactoringContract(order.contract.contractNo).company.fullName : order.customer.app.company.fullName}</td>
                    <td><fmt:formatDate value="${order.dueDate}" pattern="yyyy/MM/dd" /></td>
                    <td>&yen;&nbsp;${order.totalRent}</td>
                    <td>
                      <c:choose>
                        <c:when test="${not empty order and order.settled }">已核销</c:when>
                        <c:otherwise><fmt:message key="${order.orderStatus.key}" /></c:otherwise>
                      </c:choose>
                    </td>
                    <td>
                      <a href="${ctx}/orders/all/${order.id}/detail">详情</a>
                    </td>
                  </tr>
                </c:forEach>
              </tbody>
           </table>
           
           <jsp:include page="/WEB-INF/include/page.jsp">
               <jsp:param value="orders/all" name="url" />
           </jsp:include>

       </div>
       <%-- <%@ include file="/WEB-INF/include/footer.jsp"%> --%>
       
    </div>

  </div>

  <%@ include file="/WEB-INF/include/script.jsp"%>
  <script src="${ctx.resource}/js/bootstrap-switch.min.js"></script>
  <script src="${ctx.resource}/js/bootstrap-modal-trigger.js"></script>
  <script src="${ctx.resource}/js/select2.min.js"></script>
  <script src="${ctx.resource}/js/select2_locale_zh-CN.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.en.js"></script>
  <script src="${ctx.resource}/js/earth-preupload.js"></script>
  <script src="${ctx.resource}/js/bootstrap-alert-fade-trigger.js"></script>
  
</body>
</html>
